package com.lck.blogmanager.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lck.blogmanager.entity.QuestionEntity;
import com.lck.blogmanager.req.PageBlogReq;
import com.lck.blogmanager.req.PageQuestionReq;
import com.lck.blogmanager.req.UserBlogListReq;
import com.lck.blogmanager.req.UserQuestionListReq;
import com.lck.blogmanager.res.PageBlogRes;
import com.lck.blogmanager.res.PageQuestionRes;
import com.lck.blogmanager.res.UserBlogListRes;
import com.lck.blogmanager.res.UserQuestionListRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

@Component
@Mapper
public interface QuestionMapper extends BaseMapper<QuestionEntity> {

    Page<PageQuestionRes> PageQuestion(@Param("req") PageQuestionReq req,
                                       Page page);

    Page<UserQuestionListRes> userList(@Param("req") UserQuestionListReq req,
                                       Page page);

    Page<PageQuestionRes> UserCenterPageQuestion(@Param("req") PageQuestionReq req,
                                                 @Param("userId") Integer userId,
                                                 Page page);
}
